package com.zucc.app.mappers;

import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import com.zucc.app.domains.ClassInfo;

/**
 * Created by hegy on 2018/4/13.
 */
@Mapper
@Component("classMapper")
public interface ClassMapper {

    @Insert("INSERT INTO class(className,teacherName,classInfo) VALUES"
            + "(#{className}, #{teacherName},#{classInfo})")
    int insert(@Param("className") String className, @Param("teacherName") String teacherName,
            @Param("classInfo") String classInfo);
    
    @Select("select * from class")
    List<ClassInfo> selectList();
    
    @Select("select * from class where id = #{id}")
    ClassInfo selectInfo(@Param("id") Integer id);
}
